package com.yang.design.create.factory.simpleFactory;

import com.yang.design.create.factory.com.AwardInfo;

/**
 * 具体工厂
 */
public class FreeGoodsFactory {
    public static IFreeGoods getInstance(AwardInfo awardInfo){
        IFreeGoods freeGoods = null;
        if (awardInfo.getAwardType() == 1){
            freeGoods = new DiscountFreeGoods();
        }else if (awardInfo.getAwardType() == 2){
            freeGoods = new SmallGiftFreeGoods();
        } else if (awardInfo.getAwardType() == 3){
            freeGoods = new YouKuMemberFreeGoods();
        }

        return freeGoods;
    }
}
